from flask import Flask,request,render_template
from wechat.Sign import Signs

app=Flask(__name__)



@app.route('/jssdk')
def jssdk_config():
   sign=Signs(request.url)
   
   result=sign.config()

   return render_template("index.html",
         timestamp=result["timestamp"],
         nonceStr=result["nonceStr"],
         signature=result["signature"])

#js接口安全域名
@app.route('/jssdk/MP_verify_PG8NVuoJl5WTt606.txt')
def get_mp_verify():
    return send_from_directory(app.static_folder,
                               "MP_verify_PG8NVuoJl5WTt606.txt")



@app.route('/')
def index():
   return "hello"

if __name__ == "__main__":
    app.run(host="127.0.0.1",port=80,debug=True)